import axios from '@/utils/request.js'
//查找全部的栏目信息
export function findAllCategory(params){
    return axios.get("/category/findAll",{params})
}
//分页查找所有的栏目信息
export function findAll(params){
    let obj = {...params};
    obj.page--;
    // if (!params.status){
    //     delete params.status;
    // }
    //遍历对象
    for (let key in obj){
        if(obj[key]===0){
            continue;
        }
        if(!obj[key]){
            delete obj[key]
        }
    }
    return axios.post('/category/query',obj)
}
//保存栏目信息
export function saveOrUpdate(params){
    return axios.post("/category/saveOrUpdate",params)
}
//通过id删除栏目信息
export function deleteCategoryById(params){
    return axios.get("/category/deleteById",{params})
}